
cmake_minimum_required(VERSION 3.4.1)

include_directories(src/main/cpp/include)

add_library(
             player

             SHARED

             src/main/cpp/player.cpp
             src/main/cpp/BasePlayer.cpp
             src/main/cpp/FFmpeg.cpp
             src/main/cpp/JavaCall.cpp
             src/main/cpp/Audio.cpp
             src/main/cpp/Video.cpp
             src/main/cpp/Queue.cpp
             src/main/cpp/PlayStatus.cpp
             src/main/cpp/AudioChannel.cpp
             src/main/cpp/SmartMediaPlayer/Msq_q.cpp
             src/main/cpp/SmartMediaPlayer/MsgQueue.cpp
             src/main/cpp/SmartMediaPlayer/SmartMediaPlayer.cpp
             )

#添加libavcodec-57.so
add_library( avcodec
             SHARED
             IMPORTED)
set_target_properties( avcodec
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavcodec.so)


#添加libavdevice-57.so
add_library( avdevice
             SHARED
             IMPORTED)
set_target_properties( avdevice
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavdevice.so)

add_library( avfilter
             SHARED
             IMPORTED)
set_target_properties( avfilter
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavfilter.so)

add_library( avformat
             SHARED
             IMPORTED)
set_target_properties( avformat
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavformat.so)

add_library( avutil
             SHARED
             IMPORTED)
set_target_properties( avutil
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libavutil.so)

add_library( swresample
             SHARED
             IMPORTED)
set_target_properties( swresample
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libswresample.so)

add_library( swscale
             SHARED
             IMPORTED)
set_target_properties( swscale
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libswscale.so)

add_library( postproc
             SHARED
             IMPORTED)
set_target_properties( postproc
                       PROPERTIES IMPORTED_LOCATION
                       ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libpostproc.so)



target_link_libraries( # Specifies the target library.
                       player
                       avcodec
                       avdevice
                       avfilter
                       avformat
                       avutil
                       swresample
                       swscale
                       postproc
                       OpenSLES
                       android
                       log
                        )